﻿using WPF.Core.Dtos;
using WPF.Core.Models;

namespace WPF.Core.Services
{
    /// <summary>
    /// 用户服务
    /// </summary>
    public class UserService : BaseService<UserModel, User>
    {
        /// <summary>
        /// 用户登录
        /// </summary>
        /// <param name="account"></param>
        /// <param name="password"></param>
        /// <returns></returns>
        public async Task<User> LoginAsync(string account, string password)
        {
            return await Sqlite.Select<User>().Where(q => q.Account == account && q.Password == password)
                 .FirstAsync();
        }
    }
}
